;
(function() {
	module.exports = {
		toUrl: function() {
			if (isDev) {
				var base_url = "http://dev.dotnar.com:3000/s/"
			} else {
				base_url = "http://s.dotnar.com/"
			}
			return base_url + this._id;
		},
		save: function() {
			db.update(config.dbname.short, this._id, this);
		},
		changeValue: function(new_value) {
			if (new_value === this.value) {
				return;
			}
			var short_index = ShortCon.findByValue();
			db.remove(config.dbname.shortIndex, this.value);
			this.value = new_value;
			this.save();
			db.insert(config.dbname.shortIndex, {
				_id: new_value,
				value: this._id
			});
		}
	};
	var os = require("os");
	var isDev = os.platform() === "win32";
	var ShortCon = require("../short/_con");
	var db = require("../db/index");
	var config = require("../_include/config");
}());